package net.e4net.watrix.proc.member;

import java.sql.Connection;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import net.e4net.watrix.common.tao.TaoDataSet;
import net.e4net.watrix.common.tao.TaoException;
import net.e4net.watrix.common.tao.TaoResult;
import net.e4net.watrix.common.tao.simpleDao.QueryProcess;

@SuppressWarnings("serial")
public class MemberListProc extends QueryProcess{
	
			
	public String getQuery(){
		
		
		StringBuffer sb01 = new StringBuffer();
		sb01.append("\nSELECT NAME, DEPARTMENT, MCODE, HP FROM MEMBER");
						
		return sb01.toString();
}
	public TaoResult process(Connection con, TaoDataSet dataset) throws TaoException {
		
		PreparedStatement pstmt = null;
		ResultSet rs = null;
		TaoResult result = null;

		try{
			pstmt = con.prepareStatement(getQuery());
		

			rs = pstmt.executeQuery();
			result = getTaoResult(rs);
	
		}catch (Throwable t) {
            throw new TaoException(processTitle, t);
        } finally {
            if (rs != null) try { rs.close(); } catch (SQLException e) {}
            if (pstmt != null) try { pstmt.close(); } catch (SQLException e) {}
        }

        return result;
    
	}

}
